{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=2992
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var
	i,n:longint;
	a:array[0..1000010] of int64;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
a[1]:=3;
a[2]:=8;
for i:=3 to n do
	a[i]:=(a[i-1]+a[i-2])*2;
write(a[n]);
end.